import { Spin } from 'antd'
import React, { Suspense } from 'react'

export const lazyLoad = (Component: React.LazyExoticComponent<() => JSX.Element>): React.ReactNode => {
  return (
    <Suspense
      fallback={<Spin style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100%' }} />}
    >
      <Component />
    </Suspense>
  )
}
